import request from '@/config/axios'


// ERP BOM API
export const bomApi = {
  // 查询BOM分页
  getStockCheckPage : async (params: any) => {
    return await request.get({ url: `/erp/product-bom/page`, params })
  },
  getStockCheckPage2 : async (params: any) => {
    return await request.get({ url: `/erp/material/page`, params })
  },
  // 查询BOM详情
  getSbomCheck: async (id: number) => {
    return await request.get({ url: `/erp/product-bom/get?id=` + id })
  },

  // 新增BOM
  creatbomCheck: async (data: StockCheckVO) => {
    return await request.post({ url: `/erp/product-bom/create`, data })
  },

  // 修改BOM
  updatbomCheck: async (data: StockCheckVO) => {
    return await request.put({ url: `/erp/product-bom/update`, data })
  },

  // 更新BOM
  updateStockCheckStatus: async (id: number, status: number) => {
    return await request.put({
      url: `/erp/stock-check/update-status`,
      params: {
        id,
        status
      }
    })
  },

  // 删除BOM

 delete: async (data: any) => {
  return await request.delete({ url: `/erp/product-bom/delete?id=`+data, })
},



  // 导出BOM Excel
  exportStockCheck: async (params) => {
    return await request.download({ url: `/erp/stock-check/export-excel`, params })
  }
}
